// Copyright (c) Microsoft Corporation.  All rights reserved.
using System;

namespace BankAccountNS
{
	/// <summary> 
	/// Bank Account demo class. 
	/// </summary> 
	public class BankAccount
	{
		private string m_customerName;

		private double m_balance;

		public BankAccount(string customerName, double balance)
		{
			m_customerName = customerName;
			m_balance = balance;
		}

		public string CustomerName
		{
			get { return m_customerName; }
		}

		public double Balance
		{
			get { return m_balance; }
		}

		public void Debit(double amount)
		{
			if (amount < 0)
			{
				throw new ArgumentOutOfRangeException("amount");
			}

			m_balance += amount;
		}

		public void Credit(double amount)
		{
			if (amount > m_balance)
			{
				throw new ArgumentOutOfRangeException("amount");
			}

			m_balance -= amount;
		}

		//        // new enum: 
		//        private enum accountType 
		//        { 
		//            Gold, 
		//            Platinum, 
		//        } 
		// 
		//        // private method: 
		//        private accountType GetAccountType 
		//        { 
		//            get 
		//            { 
		//                if (Balance > 15.00) 
		//                    return accountType.Platinum; 
		//                else 
		//                    return accountType.Gold; 
		//            } 
		//        } 

		public static void Main()
		{
			BankAccount ba = new BankAccount("Mr. Bryan Walton", 11.99);

			ba.Credit(5.77);
			ba.Debit(11.22);
			Console.WriteLine("Current balance is ${0}", ba.Balance);
			//Console.ReadKey(); 
		}

	}
}

/* The example companies, organizations, products, domain names, e-mail addresses, logos, people, places, and events depicted herein are fictitious.  No association with any real company, organization, product, domain name, email address, logo, person, places, or events is intended or should be inferred. */
